package com.eos.orm.c3p0.dao;

import java.util.List;
import java.util.Map;

import com.hf.utils.PaginationBean;

/**
 * C3P0连接池DAO层的接口
 * 
 * @author Administrator
 * 
 * @param <T>
 */
public interface IDAO<T> {

	/**
	 * ִbatch insert 批处理插入
	 * 
	 * @param t
	 * @return boolean
	 */
	public boolean save(List<T> t);

	/**
	 * batch update 批处理更新
	 * 
	 * @param t
	 * @return boolean
	 */
	public boolean update(List<T> t);

	/**
	 * 批处理删除
	 * 
	 * @param t
	 * @return boolean
	 */
	public boolean remove(List<T> t);

	/**
	 * curpage find 分页查询
	 * 
	 * @param map
	 *            {cur_page,pag_esize...}
	 * @return List<T>
	 */
	public List<T> findPage(Map<String, String> map);

	/**
	 * 
	 * 获取分页查询bean
	 * 
	 * @param map
	 *            {table_name,page_size,condition}
	 * 
	 * @return PaginationBean
	 */
	public PaginationBean findBean(Map<String, String> map);

	/**
	 * where find 条件查询
	 * 
	 * @param map
	 *            {...}
	 * @return List<T>
	 */
	public List<T> findByWhere(Map<String, String> map);

	/**
	 * execute procedure
	 * 
	 * @return
	 */
	public boolean doCall();

	/**
	 * sqlscript' sql of #1
	 * 
	 * @param map
	 * 
	 * @return
	 */
	public String condition1(Map<String, String> map);

	/**
	 * sqlscript'sql of #2
	 * 
	 * @param map
	 * 
	 * @return
	 */
	public String condition2(Map<String, String> map);

}
